import { jsx as _jsx } from "react/jsx-runtime";
import { Switch } from 'antd';
import { useEffect, useState } from 'react';
const FormSwitch = (props) => {
    const { onChange, value = false } = props;
    const [checked, setChecked] = useState(value);
    const valueChange = (date) => {
        // console.log(date)
        setChecked(date);
    };
    useEffect(() => {
        onChange && onChange(checked);
    }, [checked]);
    return _jsx(Switch, { checked: checked, onChange: valueChange });
};
export default FormSwitch;
